USE [SRD]
GO

/****** Object:  Table [dbo].[SUBMISSAO]    Script Date: 05/14/2011 11:01:13 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SUBMISSAO](
	[SUBMISSAO_ID] [int] IDENTITY(1,1) NOT NULL,
	[DESCRICAO] [nvarchar](70) NOT NULL,
	[DATA] [datetime] NOT NULL,
	[EMPRESA_ID] [int] NOT NULL,
	[PROFISSIONAL_ID] [int] NOT NULL,
	[PROJETO_ID] [int] NOT NULL,
	[STATUS_SUBMISSAO_ID] [int] NOT NULL,
 CONSTRAINT [PK_SUBMISSAO] PRIMARY KEY CLUSTERED 
(
	[SUBMISSAO_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[SUBMISSAO]  WITH CHECK ADD  CONSTRAINT [FK_SUBMISSAO_EMPRESA] FOREIGN KEY([EMPRESA_ID])
REFERENCES [dbo].[EMPRESA] ([EMPRESA_ID])
GO

ALTER TABLE [dbo].[SUBMISSAO] CHECK CONSTRAINT [FK_SUBMISSAO_EMPRESA]
GO

ALTER TABLE [dbo].[SUBMISSAO]  WITH CHECK ADD  CONSTRAINT [FK_SUBMISSAO_PROFISSIONAL] FOREIGN KEY([PROFISSIONAL_ID])
REFERENCES [dbo].[PROFISSIONAL] ([PROFISSIONAL_ID])
GO

ALTER TABLE [dbo].[SUBMISSAO] CHECK CONSTRAINT [FK_SUBMISSAO_PROFISSIONAL]
GO

ALTER TABLE [dbo].[SUBMISSAO]  WITH CHECK ADD  CONSTRAINT [FK_SUBMISSAO_PROJETO] FOREIGN KEY([PROJETO_ID])
REFERENCES [dbo].[PROJETO] ([PROJETO_ID])
GO

ALTER TABLE [dbo].[SUBMISSAO] CHECK CONSTRAINT [FK_SUBMISSAO_PROJETO]
GO

ALTER TABLE [dbo].[SUBMISSAO]  WITH CHECK ADD  CONSTRAINT [FK_SUBMISSAO_STATUS_SUBMISSAO] FOREIGN KEY([STATUS_SUBMISSAO_ID])
REFERENCES [dbo].[STATUS_SUBMISSAO] ([STATUS_SUBMISSAO_ID])
GO

ALTER TABLE [dbo].[SUBMISSAO] CHECK CONSTRAINT [FK_SUBMISSAO_STATUS_SUBMISSAO]
GO


